﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DSS_XNA.Engine.Error;
using DSS_XNA.Engine.Script;

namespace DSS_XNA.Engine.Script.Commands
{
    public class ScriptCommand_SetScreenSize
    {
        #region Static Methods

        public static void Action(Dictionary<string, string> args, ScriptManager manager, Game1 engine)
        {
            if (!args.ContainsKey("width"))
                throw new DSSException("No Width parameter for SetScreenSize");
            if (!args.ContainsKey("height"))
                throw new DSSException("No Height parameter for SetScreenSize");
            if (!args.ContainsKey("fullscreen"))
                throw new DSSException("No FullScreen parameter for SetScreenSize");

            int width = Convert.ToInt32(manager.GetParameterValue(args["width"]));
            int height = Convert.ToInt32(manager.GetParameterValue(args["height"]));
            bool fullscreen = Convert.ToBoolean(manager.GetParameterValue(args["fullscreen"]));

            engine.SetScreenSize(width, height, fullscreen);
        }

        #endregion
    }
}
